"""
区间估计
"""
import pandas as pd
import numpy as np
from scipy import stats

mass = pd.Series([506, 508, 499, 503, 504, 510, 497, 512,
                  514, 505, 493, 496, 506, 502, 509, 496])

mean, std = mass.mean(), mass.std()
interval = stats.norm.interval(0.95, mean, std)
print('总体均值的置信度为0.95的置信区间是{}'.format(interval))
